package com.paranoidmonkey.ode.Joint;

import com.paranoidmonkey.ode.AndrODE;
import com.paranoidmonkey.ode.World;

public class Universal extends Joint{
	public Universal(World world,JointGroup group){
		handle=AndrODE.dJointCreateUniversal (world.getHandle(), group.groupID);
	}
	public void setAnchor(float x, float y, float z){
		AndrODE.dJointSetUniversalAnchor (handle, x, y, z);
	}
	public void setAxis1(float x, float y, float z){
		AndrODE.dJointSetUniversalAxis1 (handle, x, y, z);
	}
	public void setAxis1Offset(float x, float y, float z, float offset1, float offset2){
		AndrODE.dJointSetUniversalAxis1Offset (handle, x, y, z, offset1, offset2);
	}
	public void setAxis2(float x, float y, float z){
		AndrODE.dJointSetUniversalAxis2 (handle, x, y, z);
	}
	public void setAxis2Offset(float x, float y, float z, float offset1, float offset2){
		AndrODE.dJointSetUniversalAxis2Offset (handle, x, y, z, offset1, offset2);
	}
	public void setParam(int parameter, float value){
		AndrODE.dJointSetUniversalParam (handle, parameter, value);
	}
	public void addTorques(float torque1, float torque2){
		AndrODE.dJointAddUniversalTorques(handle, torque1, torque2);
	}
	public void getAnchor(float[] result){
		AndrODE.dJointGetUniversalAnchor (handle, result);
	}
	public void getAnchor2(float[] result){
		AndrODE.dJointGetUniversalAnchor2 (handle, result);
	}
	public void getAxis1(float[] result){
		AndrODE.dJointGetUniversalAxis1 (handle, result);
	}
	public void getAxis2(float[] result){
		AndrODE.dJointGetUniversalAxis2 (handle, result);
	}
	public float getParam(int parameter){
		return AndrODE.dJointGetUniversalParam (handle, parameter);
	}
	public void getAngles( float []angle1, float []angle2){
		AndrODE.dJointGetUniversalAngles (handle, angle1, angle2);
	}
	public float getAngle1(){
		return AndrODE.dJointGetUniversalAngle1 (handle);
	}
	public float getAngle2(){
		return AndrODE.dJointGetUniversalAngle2 (handle);
	}
	public float getAngle1Rate(){
		return AndrODE.dJointGetUniversalAngle1Rate (handle);
	}
	public float getAngle2Rate(){
		return AndrODE.dJointGetUniversalAngle2Rate (handle);
	}

}
